var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var openHelper = require("helper/open");
var httpSilence = require("helper/httpSilence");
var rootview = ui("$");
var orderItem = ui("orderItem");
var mallUrl = require("url/mall");
var do_Label_name = ui("do_Label_name");
var do_ALayout_1 = ui("do_ALayout_1");
rootview.setMapping({
	"do_ALayout_1.tag" : "orderType",
	"do_Label_name.tag": "productId",
	"do_Label_name.text" : "productName",
	"do_Label_price.text" : "productPrice",
	"do_Label_count.text" : "productCount",
	"do_ImageView_img.source" : "productImg"
}); 
//商品详情
orderItem.on("touch",function(){
	//1-服务 2-商城
	var orderType = do_ALayout_1.tag;
	var productId = do_Label_name.tag
	if(orderType == 2 || orderType == 6){
		httpSilence.post(mallUrl.url.product.getProductBySpecId, {id:productId}, function(data) {
			var product = data.mallProduct;
			if(product && product.id){
				openHelper.open("source://view/mall/product/main.ui",{id:product.id});
			}else{
				nf.toast("商品过期不存在");
			}
		});
	}
});

